<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>我的发布</title>
<link rel="stylesheet" href="https://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<style>
.myTitleImg{

	background-image:url("image/ipad.jpg");
	background-repeat:no-repeat;
	background-size:100% 100%;
	height:320px;
	
}
h1 a:hover{

	text-decoration:underline;

}

</style>
<script>
function GetRequest() {
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}

var a=GetRequest();
var index_1=a['newsid'];
var j = {"newsid":index_1};

$.ajax({
	type : "post",
	url : "<c:url value='/NewsServlet?method=newsSelect'/>",            //servlet需要提前在web.xml里面注册
	dataType : "json",
	data :j,
	success : function(data,textStatus)
	{
        //data为后端post函数传递来的数据，这里写结果操作代码
		var objs = eval(data);  //解析json对象
		$("#newsauthod").attr("value",objs[0].newsauthod);
		$("#newsauthod_s").attr("value",objs[0].newsauthod);
		$("#newsid").attr("value",objs[0].newsid);
		$("#newsid_s").attr("value",objs[0].newsid);
		$("#newsclass").attr("value",objs[0].newsclass);
		$("#newsclass_s").attr("value",objs[0].newsclass);
		
	},
	error : function(xhr, status, errMsg)
	{
		alert("数据加载失败!");
	}
});



</script>
<body>



			<div class="container" >

				<div class=" myTitleImg text-center">
					<div style="position:relative ;top:60%">
						<h1 ><a href="index.jsp" style="color:#ffffff;">信科买卖 </a> </h1>
						<h1 style="color:#ffffff;">————*———— </h1>
					</div>
				</div>
				
				<h3 style="color: #800000">${info }</h3>
				<h3 style="color: greenyellow">${info_success }</h3>               													<!-- 反馈信息 -->
				
						
			<!-- 表单 -->
			<form class="form-horizontal"
				action="AddDataServlet" method="post" enctype="multipart/form-data">
				<div class="form-group form-group-lg has-info">
					<div class="input-group col-md-6  col-sm-9">
						<div class="input-group-addon "
							style="background: #339933; color: white">
							<span class="glyphicon glyphicon-user "> 您的昵称</span>       									<!-- 姓名id="newsauthod" -->
						</div>
						<input id="newsauthod" class="form-control" type="text"  value=''  disabled>
						<input id="newsauthod_s" class="form-control" name="newsauthod" type="text" value=''  style="display:none" >	
					</div>

				</div>
		
		
				<div class="form-group form-group-lg has-info">
					<div class="input-group col-md-6  col-sm-9">
						<div class="input-group-addon "
							style="background: #339933; color: white">
							<span class="glyphicon glyphicon-lock "> 商品类型</span>
						</div>
						<input id="newsclass"  class="form-control"  type="text" disabled  >                     <!-- 商品类型 id="newsclass"-->
						<input id="newsclass_s" class="form-control" name="newsclass" type="text" vlaue='' style="display:none" >	
						
					</div>
				</div>
				
			

				<div class="form-group form-group-lg has-info">
					<div class="input-group col-md-6  col-sm-9">
						<div class="input-group-addon "
							style="background: #339933; color: white">
							<span class="glyphicon glyphicon-lock "> 商品位置</span>
						</div>
						<input id="newsid"  class="form-control"  type="text"  disabled  >
						<input id="newsid_s" class="form-control" name="newsid" type="text" style="display:none" >				<!-- 商品位置 id="newsid"-->
						
					</div>
				</div>
		
				
		
			<div class="form-group form-group-lg has-info">
					<div class="input-group col-md-6  col-sm-9">
						<div class="input-group-addon "
							style="background: #339933; color: white">
							<span class="glyphicon glyphicon-lock "> 商品标题</span>
						</div>
						
						<input class="form-control" name="newstitle" type="text"  >				<!-- 商品标题 id="newstitle"-->
						
					</div>
				</div>
		
		
		<div class="form-group form-group-lg has-info">
					<div class="input-group col-md-6  col-sm-9">
						<div class="input-group-addon "
							style="background: #339933; color: white">
							<span class="glyphicon glyphicon-lock "> 商品内容</span>
						</div>
						
						<input class="form-control" name="newscontent" type="text"  >				<!-- 商品内容 id="newstitle"-->
					</div>
				</div>
		
		<div class="form-group form-group-lg has-info">
					<div class="input-group col-md-6  col-sm-9">
						<div class="input-group-addon "
							style="background: #339933; color: white">
							<span class="glyphicon glyphicon-lock "> 上传图片</span>
						</div>
						<input  name="attach" class="form-control"  type="file" id="attach" >					<!--添加图片 -->
					</div>
				</div>
			
		
		
		<div class="form-group form-group-lg has-info">
					<div class="input-group col-md-6  col-sm-9">
						<div class="input-group-addon "
							style="background: #339933; color: white">
							<span class="glyphicon glyphicon-lock "> 联系电话</span>
						</div>
						
						<input class="form-control" name="tell" type="text"  >				<!-- 联系电话 id="tell"-->
					</div>
				</div>

				<div class="form-group form-group-lg has-info">
					<div class="input-group col-md-6  col-sm-9">
						<div class="input-group-addon "
							style="background: #339933; color: white">
							<span class="glyphicon glyphicon-lock "> 上传时间</span>
						</div>
						
						<input class="form-control" name="newspushdays" type="text"  >				<!-- 上传时间 id="newspushdays"-->
					</div>
				</div>
				
				
				
				

				<div class="form-group ">
					<div class="input-group col-md-6  col-sm-9 col-xs-12">
						
							<div class="col-md-7 col-xs-6 col-sm-7">
								<button type="submit" id="submits"
									class="btn btn-primary btn-block btn-lg"
									style="text-shadow: black 5px 3px 3px;">
									<span class="glyphicon glyphicon-hand-right"></span> 马上发布
								</button>
							</div>
							
						
					</div>
				</div>
			</form>
			
			
			
			
			
			
		</div>


</body>
</html>
	
	<!-- <FORM  METHOD="POST" ACTION="AddDataServlet"
		ENCTYPE="multipart/form-data">
		 用户名：<input name="userName" type="text" > <br/><br/>
		 商品位置：<input name="newsId" type="text"> <br/><br/>
		 附件 <input name="attach" type="FILE"  size="50" /><br/></br>
		 <input name="ok" type="submit" value="提交">
	</form> -->
	
	
	
	
	
	
	
	
	
	
	
	
	
	

